//JavaScript代码区域
layui.use(['table','laydate'], function(){
    loadData();

    layui.laydate.render({
        elem: '#test1' //指定元素
    });
});


function loadData() {
    layui.table.render({
        elem: '#tableData'
        , height: 'full-300'
        , url: '/findAll' //数据接口
        , page: true //开启分页
        , cols: [[ //表头
            {field: 'employeename', title: '姓名', width: 120, sort: true, fixed: 'left'}
            , {field: 'employeeid', title: '工号', width: 120}
            , {field: 'deptname', title: '部门', width: 120, sort: true}
            , {field: 'position', title: '职位', width: 150}
            , {field: 'employeetype', title: '员工类型', width: 180}
            , {field: 'hiredate', title: '入职日期', width: 200, sort: true}
            , {field: 'mobilephone', title: '手机号', width: 200, sort: true}
            , {field: 'operation', title: '操作', width: 160}
        ]]
    });

}